package com.cqupt.scanning.system.file.helper.utils;

import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;

import java.io.File;

/**
 * @Description:
 * @ClassName: unZipUtil
 * @Date: 2021/3/10 10:52
 * @Author: 宋宝梁
 */


public class UnZipUtil {

    /**
     * 解压
     * @param file zip类型的文件
     * @param dest 解压目录
     */
    public static void doZip(File file, String dest) {
        try {
            ZipFile zipFile = new ZipFile(file);
//            zipFile.setFileNameCharset("UTF-8");
            zipFile.setFileNameCharset("GBK");
            zipFile.extractAll(dest);
        } catch (ZipException e) {
            e.printStackTrace();
        }
    }
}
